﻿ <!--
 PrescriptionDialog.xaml
 
 WPF dialog for the taking the user input (number of fractions, dose per fractions, 
 PTV margin, CTV) for automated plan generation.
  
 Copyright (c) 2015 Varian Medical Systems, Inc.

 Permission is hereby granted, free of charge, to any person obtaining a copy 
 of this software and associated documentation files (the "Software"), to deal 
 in the Software without restriction, including without limitation the rights 
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 copies of the Software, and to permit persons to whom the Software is 
 furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in 
  all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
 THE SOFTWARE.
  -->
  
  <Window x:Class="VMS.TPS.PrescriptionDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             d:DesignHeight="350" d:DesignWidth="300"
             Title="Prescription">
  <StackPanel>
    <Grid>
      <!--Row and column definitions (2x2 grid)-->
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>

      <!--Labels-->
      <Label Content="Patient ID" Grid.Column="0" Grid.Row="0" Margin="15,15,10,10"/>
      <Label Content="Dose per fraction" Grid.Column="0" Grid.Row="1" Margin="15,0,10,10"/>
      <Label Content="Number of fractions" Grid.Column="0" Grid.Row="2" Margin="15,0,10,10"/>
      <Label Content="Margin for PTV (in mm)" Grid.Column="0" Grid.Row="3" Margin="15,0,10,10"/>
      <Label Content="Select CTV" Grid.Column="0" Grid.Row="4" Margin="15,0,10,10"/>

      <!--Input-->
      <TextBox Grid.Column="1" Grid.Row="0" Width="80" Margin="15,15,10,15" Text="{Binding PatientId, Mode=OneWay}" IsEnabled="False"/>
      <TextBox Grid.Column="1" Grid.Row="1" Width="80" Margin="15,0,10,15" Text="{Binding DosePerFraction, Mode=TwoWay}"/>
      <TextBox Grid.Column="1" Grid.Row="2" Width="80" Margin="15,0,10,15" Text="{Binding NumberOfFractions, Mode=TwoWay}"/>
      <TextBox Grid.Column="1" Grid.Row="3" Width="80" Margin="15,0,10,15" Text="{Binding PTVMargin, Mode=TwoWay}"/>
      <ListBox x:Name="m_structureSelection" Grid.Column="1" Grid.Row="4" Width="100" Height="70"  Margin="15,0,10,15" ItemsSource="{Binding Structures, Mode=OneWay}" SelectionChanged="OnItemSelectionChanged"/>
    </Grid>
    
    <Button x:Name="m_okButton"  Content="OK" Width="100" Margin="15" Click="OnOkButtonClick" IsEnabled="False"/>
  </StackPanel>
</Window>
